package com.lotto.manager.admin.service.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.lotto.manager.admin.dao.AllocMapper;
import com.lotto.manager.admin.entity.db.Alloc;
import com.lotto.manager.admin.service.AllocService;
import com.lotto.manager.admin.system.SystemData;

public class AllocServiceImpl implements AllocService {
	
	@Autowired
	private AllocMapper allocMapper;
	
	@Override
	public Alloc findAccountByUserid(Integer userid) {
		Alloc alloc = SystemData.findAllocByUserid(userid);
		if(null == alloc){
			alloc = allocMapper.findAccountByUserid(userid);
			if(null != alloc){
				SystemData.addAlloc(userid, alloc);
			}
		}
		return alloc;
	}

}
